home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle: Internet utan modem / Internet CD.iso / web / computer / wwweps~1.com / adam / garbage.dcr / Internal_5.ls < prev    next >
Encoding:
Text File  |  1997-03-17  |  907 b   |  51 lines

  1. on update_all
  2.   global board_list
  3.   repeat with i in board_list
  4.     update_me(i)
  5.   end repeat
  6. end
  7.  
  8. on shuffle_pieces
  9.   global board_list
  10.   set temp to []
  11.   repeat with n = 16 down to 1
  12.     set t to random(n)
  13.     set i to getAt(board_list, t)
  14.     deleteOne(board_list, i)
  15.     add(temp, i)
  16.   end repeat
  17.   set board_list to duplicate(temp)
  18. end
  19.  
  20. on check_if_right
  21.   global complete_list, board_list, can_I_win
  22.   if can_I_win = 0 then
  23.     return 
  24.   end if
  25.   repeat with n = 1 to 16
  26.     if not (getAt(board_list, n) = getAt(complete_list, n)) then
  27.       return 
  28.     end if
  29.   end repeat
  30.   go("win")
  31. end
  32.  
  33. on shuffle
  34.   global can_I_win
  35.   set can_I_win to 1
  36.   puppetSound(1, "shuffle3")
  37.   repeat while soundBusy(1)
  38.     shuffle_pieces()
  39.     update_all()
  40.     updateStage()
  41.   end repeat
  42. end
  43.  
  44. on change_all
  45.   global board_list
  46.   puppetSound(2, "finish")
  47.   repeat with i in board_list
  48.     change_state(i)
  49.   end repeat
  50. end
  51.